<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
</head>

<body>
  <div id="app">
     <!-- v-bind:value="username"
    v-on:input="" -->
    <custom-input 
    v-model="username"
    ></custom-input>
  </div>
  <script>


    Vue.component('custom-input', {
      props:['value'],
      template: `
          <input :value="value" @input="handleInput" />
      `,
      methods: {
       handleInput(event){
        this.$emit('input',event.target.value)
       }
      }
    })

    var vm = new Vue({
      el: "#app",
      data: {
        username: ""
      },
      methods: {
       
      }
    })


  </script>

</body>

</html>